package cn.jetpiece.cloud.config.properties;

import lombok.Data;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 网关配置
 */
@Data
public class JetpieceGatewayProperties {

    /**
     * 前缀
     */
    public static final String PREFIX = "jetpiece.gateway";

    /**
     * 静态配置
     */
    private static JetpieceGatewayProperties INSTANCE;

    /**
     * 在线文档
     */
    private Boolean doc = false;

    /**
     * ip地址
     */
    private Boolean enableLog = false;

    /**
     * 本机IP优先路由
     * 适用于本机跑网关，切需要优先转发到本机其它服务
     */
    private Boolean localIpPreferenceRoute = false;

    /**
     * 指定服务需要忽略某些url校验
     */
    private Map<String, List<String>> serverIgnoreUrl = new HashMap<>();

    /**
     * 指定服务需要忽略某些地址结尾校验
     */
    private Map<String, List<String>> serverIgnoreUrlEnd = new HashMap<>();

    /**
     * 开发使用路由
     */
    private Map<String, Map<String, String>> developerRoute = new HashMap<>();

    public static JetpieceGatewayProperties getInstance() {
        return INSTANCE;
    }

    public void setInstance(JetpieceGatewayProperties instance) {
        JetpieceGatewayProperties.INSTANCE = instance;
    }


}
